home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-08-15 | 3.1 KB | 99 lines | [TEXT/MPS ] |
- // Copyright © 1990 Apple Computer, Inc. All rights reserved.
- #ifndef __IACHeaders__ // Every source file which uses the headers defined
- #include "IACHeaders.h" // In the main header file get the file included.
- #endif
-
- /**********************************Comment*****************************************
- * TMessage::TMessage is the constructor. It simply sets up the data members based
- * on what was passed in. I felt there was no point in making a constructor that
- * DIDN'T take these parameters as input because there'd be no reason to create an
- * TMessage object without them.
- **********************************End Comment************************************/
- TMessage::TMessage(char *message, short senderSig, short receiverSig)
- {
- fSenderSig = senderSig;
- fReceiverSig = receiverSig;
- tseStrCpy((char *) &fMessageString, message);
- }
-
- /**********************************Comment*****************************************
- * TMessage::~TMessage is the destructor. It's just a place holder for the time being.
- **********************************End Comment************************************/
- TMessage::~TMessage()
- {
- }
-
-
- // Public interfaces
-
- /**********************************Comment*****************************************
- * TMessage::IsMessageForMe simply returns true or false, depending on whether the
- * signature of the intended receiver of the message matches the signature of the
- * requesting application.
- **********************************End Comment************************************/
- Boolean
- TMessage::IsMessageForMe(short sigOfRequestor)
- {
- return ( this->GetReceiverSig() == sigOfRequestor );
- }
-
- /**********************************Comment*****************************************
- * TMessage::IsMessageForMe returns true or false, depending on whether the
- * signature of the intended receiver of the message matches the signature of the
- * requesting application. It also copies the message string into the buffer passed
- * in, and returns the signature of the application which sent the message.
- **********************************End Comment************************************/
- Boolean
- TMessage::IsMessageForMe(short sigOfRequestor, short *senderSig, char *messageString)
- {
- if ( this->GetReceiverSig() == sigOfRequestor )
- {
- *senderSig = this->GetSenderSig();
- tseStrCpy(messageString,this->GetMessageString());
- return(true);
- }
- else
- return (false);
- }
-
- // Private interfaces
-
- /**********************************Comment*****************************************
- * These are all straight-foward, and probably could be in-lines (except for the last
- * one which uses tseStrCpy).
- **********************************End Comment************************************/
- short
- TMessage::GetSenderSig()
- {
- return (fSenderSig);
- }
-
- short
- TMessage::GetReceiverSig()
- {
- return (fReceiverSig);
- }
-
- char*
- TMessage::GetMessageString()
- {
- return ((char *) &fMessageString);
- }
-
- void
- TMessage::SetSenderSig(short signature)
- {
- fSenderSig = signature;
- }
-
- void
- TMessage::SetReceiverSig(short signature)
- {
- fReceiverSig = signature;
- }
-
- void
- TMessage::SetMessageString(char *msgString)
- {
- tseStrCpy((char *) &fMessageString,msgString);
- }